package com.smartEdu.controller.web;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.smartEdu.commons.constant.JspView;
import com.smartEdu.service.HomeWorkReportService;
import com.smartEdu.vo.web.TableResult;

@Controller
@RequestMapping(value="/web/")
public class HworkReportController extends WebBaseController {
	@Autowired
	private HomeWorkReportService hwReportService;
	
	@RequestMapping(value="hworkreport_iframe")
	public String hworkreportIframe(HttpSession httpsession, Model model) {
		return realUrl("hworkreport", model);
	}
	
	@RequestMapping(value="hworkreport")
	public String hworkreport(HttpSession httpsession, Model model) {
		return JspView.HWORKREPORT.getName();
	}
	
	@RequestMapping(value="hworkreporttable")
	@ResponseBody
	public TableResult hworkreporttable(@RequestParam(value="pk") String pk, HttpSession httpsession, Model model) {
		return hwReportService.findStatistics(pk);
	}
	
	@RequestMapping(value="hworkreportstudetail")
	@ResponseBody
	public TableResult hworkreportstudetail(@RequestParam(value="pk") String pk, HttpSession httpsession, Model model) {
		return hwReportService.findDetaileReport(pk);
	}

}
